package com.golf.core.course.bodies;

import net.phys2d.raw.Body;
import net.phys2d.raw.StaticBody;
import net.phys2d.raw.shapes.Box;


public class Wall extends AbstractCourseBody
{
    
    private final float x;
    
    private final float y;
    
    private final float width;
    
    private final float height;
    
    
    public Wall(final String name, float x, float y, float width, float height)
    {
    	super(name);
        this.x = x;
        this.y = y;
        this.width = width;
        this.height = height;
    }
    
    
    public Body asPhysicsBody()
    {
        Body body = new StaticBody(name(), new Box(width, height));
        body.setPosition(x + width / 2, y + height / 2);

        body.setRestitution(0.4f);
        body.setFriction(1.5f);
        
        return body;
    }

    
    public Position getPosition()
    {
        return new Position(x, y);
    }

    public float getHeight()
    {
        return height;
    }
    
    public float getWidth()
    {
        return width;
    }


}
